package com.gong.DesignPattern.ObserverPattern;

import java.util.ArrayList;
import java.util.List;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/6/29 0029 9:22
 */
public class Zhangsan implements Debt {
    private List<Bower> bowers = new ArrayList<>();

    @Override
    public void borrow(Bower bower) {
        bowers.add(bower);
    }

    @Override
    public void giveBack() {
        bowers.forEach(bower->bower.takeMoney());
    }
}
